package com.itheima.easy.controller;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.itheima.easy.base.AjaxResult;
import com.itheima.easy.enums.DeptEnum;
import com.itheima.easy.service.LogoutService;
import com.itheima.easy.utils.AjaxResultBuild;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName LoginController.java
 * @Description 退出接口
 */
@RestController
@Api(tags = "用户退出")
@RequestMapping("security")
public class LogoutController {

    @Autowired
    LogoutService logoutService;


    @PostMapping("logout")
    @ApiOperation(value = "用户退出",notes = "用户退出")
    @ApiOperationSupport(includeParameters ={"userVo.username","userVo.password"} )
    public AjaxResult<Boolean> login(){
        return AjaxResultBuild.build(DeptEnum.SUCCEED,logoutService.logout());
    }
}
